﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Fcdbas.CodeBuilder
{
    public partial class TemplateDefault : Form
    {
        public TemplateDefault()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.openFileDialog1.Filter = "模版文件(*.cdb)|*.cdb";
            if (DialogResult.OK == this.openFileDialog1.ShowDialog())
            {
                string file = this.openFileDialog1.FileName;
                this.txtCDBFile.Text = file;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.openFileDialog1.Filter = "模版文件(*.pkg)|*.pkg";
            if (DialogResult.OK == this.openFileDialog1.ShowDialog())
            {
                string file = this.openFileDialog1.FileName;
                this.txtPAKFile.Text = file;
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            (this.Owner as Fcdbas.Tool.CodeBuilder).DefaultCDBFile= this.txtCDBFile.Text;
            (this.Owner as Fcdbas.Tool.CodeBuilder).DefaultPKGFile = this.txtPAKFile.Text;

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
